package org.usfirst.frc.team4586.robot.commands;

import org.usfirst.frc.team4586.robot.OI;

import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.Joystick.RumbleType;
import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj.command.Command;

/**
 *
 */
public class Rumble extends Command {
	// Joystick operatorStick;
	public Rumble() {
		// Use requires() here to declare subsystem dependencies
		// eg. requires(chassis);
		// operatorStick = CommandBase.oi.operatorStickFront;

	}

	// Called just before this Command runs the first time
	protected void initialize() {
		CommandBase.oi.drivingStick.setRumble(RumbleType.kLeftRumble,
				(float) 0.5);
		CommandBase.oi.drivingStick.setRumble(RumbleType.kRightRumble,
				(float) 0.5);
		setTimeout(2);
	}

	// Called repeatedly when this Command is scheduled to run
	protected void execute() {
	}

	// Make this return true when this Command no longer needs to run execute()
	protected boolean isFinished() {
		return isTimedOut();
	}

	// Called once after isFinished returns true
	protected void end() {
		CommandBase.oi.drivingStick
				.setRumble(RumbleType.kLeftRumble, (float) 0);
		CommandBase.oi.drivingStick.setRumble(RumbleType.kRightRumble,
				(float) 0);
	}

	// Called when another command which requires one or more of the same
	// subsystems is scheduled to run
	protected void interrupted() {
	}
}
